<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>CruiseControl.NET : Gendarme Task</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            CruiseControl.NET : Gendarme Task
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Jun 26, 2009 by <font color="#0050B2">csut017</font>.
				    </div>

				    <p>Then Gendarme task is used to run a static code analysis over your assemblies.</p>

<p><img class="emoticon" src="images/icons/emoticons/information.gif" height="16" width="16" align="absmiddle" alt="" border="0"/> See <a href="Using CruiseControl.NET with Gendarme.html" title="Using CruiseControl.NET with Gendarme">Using CruiseControl.NET with Gendarme</a> for more details.</p>

<h3><a name="GendarmeTask-Version"></a>Version</h3>

<p>This task is available from version 1.4.3.</p>

<h3><a name="GendarmeTask-Examples"></a>Examples</h3>

<p>Minimalist Example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;gendarme&gt;</span>
	<span class="code-tag">&lt;assemblies&gt;</span>
		<span class="code-tag">&lt;assemblyMatch expr='*.dll' /&gt;</span>
		<span class="code-tag">&lt;assemblyMatch expr='*.exe' /&gt;</span>
	<span class="code-tag">&lt;/assemblies&gt;</span>
<span class="code-tag">&lt;/gendarme&gt;</span></pre>
</div></div>

<p>Full example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;gendarme&gt;</span>
	<span class="code-tag">&lt;executable&gt;</span>Tools\gendarme.exe<span class="code-tag">&lt;/executable&gt;</span>
	<span class="code-tag">&lt;baseDirectory&gt;</span>C:\Build\Project1\Bin\Debug\<span class="code-tag">&lt;/baseDirectory&gt;</span>
	<span class="code-tag">&lt;configFile&gt;</span>rules.xml<span class="code-tag">&lt;/configFile&gt;</span>
	<span class="code-tag">&lt;ruleSet&gt;</span>*<span class="code-tag">&lt;/ruleSet&gt;</span>
	<span class="code-tag">&lt;ignoreFile&gt;</span>C:\Build\Project1\gendarme.ignore.list.txt<span class="code-tag">&lt;/ignoreFile&gt;</span>
	<span class="code-tag">&lt;limit&gt;</span>200<span class="code-tag">&lt;/limit&gt;</span>
	<span class="code-tag">&lt;severity&gt;</span>medium+<span class="code-tag">&lt;/severity&gt;</span>
	<span class="code-tag">&lt;confidence&gt;</span>normal+<span class="code-tag">&lt;/confidence&gt;</span>
	<span class="code-tag">&lt;quiet&gt;</span>FALSE<span class="code-tag">&lt;/quiet&gt;</span>
	<span class="code-tag">&lt;verbose&gt;</span>TRUE<span class="code-tag">&lt;/verbose&gt;</span>
	<span class="code-tag">&lt;failBuildOnFoundDefects&gt;</span>TRUE<span class="code-tag">&lt;/failBuildOnFoundDefects&gt;</span>
	<span class="code-tag">&lt;verifyTimeoutSeconds&gt;</span>600<span class="code-tag">&lt;/verifyTimeoutSeconds&gt;</span>
	<span class="code-tag">&lt;assemblyListFile&gt;</span>C:\Build\Project1\gendarme.assembly.list.txt<span class="code-tag">&lt;/assemblyListFile&gt;</span>
	<span class="code-tag">&lt;description&gt;</span>Test description<span class="code-tag">&lt;/description&gt;</span>
<span class="code-tag">&lt;/gendarme&gt;</span></pre>
</div></div>

<h3><a name="GendarmeTask-ConfigurationElements%3A"></a>Configuration Elements:</h3>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
<th class='confluenceTh'> Default </th>
<th class='confluenceTh'> Version </th>
</tr>
<tr>
<td class='confluenceTd'> executable </td>
<td class='confluenceTd'> The location of the Gendarme executable </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> gendarme.exe </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> baseDirectory </td>
<td class='confluenceTd'> The directory to run Gendarme in </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> <a href="Project Configuration Block.html#ProjectConfigurationBlock-workingDirectory">Project Working Directory</a> </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> configFile </td>
<td class='confluenceTd'> Specify the configuration file </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Default is 'rules.xml' </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> ruleSet </td>
<td class='confluenceTd'> Specify the set of rules to verify </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Default is '*' </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> ignoreFile </td>
<td class='confluenceTd'> Do not report the known defects that are part of the specified file </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> limit </td>
<td class='confluenceTd'> Stop reporting after N defects are found </td>
<td class='confluenceTd'> int </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> severity </td>
<td class='confluenceTd'> Filter the reported defects to include the specified severity levels </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Default is 'medium+' (i.e. low and audit levels are ignored) </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> confidence </td>
<td class='confluenceTd'> Filter the reported defects to include the specified confidence levels. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> Default is 'normal+' (i.e. low level is ignored) </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> quiet </td>
<td class='confluenceTd'> If true, display minimal output (results) from the runner. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> verbose </td>
<td class='confluenceTd'> Enable debugging output. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> failBuildOnFoundDefects </td>
<td class='confluenceTd'> Specify whenver the build should fail if some defects are found by Gendarme. </td>
<td class='confluenceTd'> bool </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> assemblies </td>
<td class='confluenceTd'> A set of &lt;assemblyMatch&gt; elements that define what assemblies to analyse. </td>
<td class='confluenceTd'> complex </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> assemblyListFile </td>
<td class='confluenceTd'> Specify a file that contains the assemblies to verify. You can specify multiple filenames, including masks (? and *), one by line. </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> verifyTimeoutSeconds </td>
<td class='confluenceTd'> Gets and sets the maximum number of seconds that the build may take.  If the build process takes longer than this period, it will be killed.  Specify this value as zero to disable process timeouts. </td>
<td class='confluenceTd'> int </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> 0 (disabled) </td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> description </td>
<td class='confluenceTd'> If filled in, this will be shown in the buildstage as the process name </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'>&nbsp;</td>
<td class='confluenceTd'> 1.4.3 </td>
</tr>
<tr>
<td class='confluenceTd'> dynamicValues </td>
<td class='confluenceTd'> Any dynamic parameters to be used. See <a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a> </td>
<td class='confluenceTd'> Dynamic values array - see <a href="Dynamic Parameters.html" title="Dynamic Parameters">Dynamic Parameters</a> </td>
<td class='confluenceTd'> No </td>
<td class='confluenceTd'> <em>None</em> </td>
<td class='confluenceTd'> 1.5.0 </td>
</tr>
</tbody></table>

<h4><a name="GendarmeTask-AssemblyMatchConfigurationElement%3A"></a>AssemblyMatch Configuration Element:</h4>

<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Node </th>
<th class='confluenceTh'> Description </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> Required </th>
</tr>
<tr>
<td class='confluenceTd'> expr </td>
<td class='confluenceTd'> The name expression of the Assembly, including masks (? and *). </td>
<td class='confluenceTd'> string </td>
<td class='confluenceTd'> true </td>
</tr>
</tbody></table>


<h6><a name="GendarmeTask-Example%3A"></a>Example:</h6>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;assemblies&gt;</span>
	<span class="code-tag">&lt;assemblyMatch expr='*.dll' /&gt;</span>
	<span class="code-tag">&lt;assemblyMatch expr='*.exe' /&gt;</span>
<span class="code-tag">&lt;/assemblies&gt;</span></pre>
</div></div>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="http://confluence.public.thoughtworks.org//images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Sep 29, 2009 20:59</font></td>
		    </tr>
	    </table>
    </body>
</html>